﻿using BasecampUI;
using NUnit.Framework;

namespace TestBasecampRestAPI.TestMoveToDoList
{
	[TestFixture]
	public class TestCredentialsFormMediator
	{
		[Test]
		public void Construct()
		{
			FakeCredentialsForm form = FakeCredentialsForm.GetInstance();
			CredentialsFormMediator mediator = CredentialsFormMediator.GetInstance(form);
			Assert.IsNotNull(mediator);
		}

		[Test]
		public void Load()
		{
			FakeCredentialsForm form = FakeCredentialsForm.GetInstance();
			CredentialsFormMediator mediator = CredentialsFormMediator.GetInstance(form);
			mediator.Load();
			Assert.IsTrue(form.UrlTextSetCalled);
			Assert.AreEqual(string.Empty, form.UrlTextSetLastValue);
			Assert.IsTrue(form.FocusUserNameCalled);
		}
	}
}